<!DOCTYPE html>
<html lang="ch">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Array</title>
  </head>
  <body>
    <script>
      var arr = new Array(22, 33, 44);
      document.write(arr[0]);
      document.write("====");
      document.write(arr[1]);
      document.writeln("js的Array是可变的，举例：");
      arr[10] = 100;
      document.writeln("arr[10] = 100 , 然后document.writeln(arr[10]=");
      document.writeln(arr[10]);

      //   Array的方法
      var arr = [1, 2, 3, 4];
      for (let i = 0; i < arr.length; i++) {
        console.log(arr[i]);
      }

      arr.forEach(function (e) {
        console.log(e);
      });

      console.log("=====lambda表达式======");
      //   lambda表达式
      arr.forEach((e) => console.log(e));
    </script>
  </body>
</html>
